package ev.initial;//need to add this line

import java.util.Arrays;

public class Individual implements Comparable{
	private boolean[] strategy;
	public boolean[] getStrategy() {
		return strategy;
	}

	public void setStrategy(boolean[] strategy) {
		this.strategy = strategy;
	}

	public int[] getPacing() {
		return pacing;
	}

	public void setPacing(int[] pacing) {
		this.pacing = pacing;
	}
	private int[] pacing;
	private double time;

	public Individual(boolean[] strategy,int[] pacing) {
		this.strategy = strategy;
		this.pacing = pacing;
	}

	public double getTime() {
		return time;
	}

	public void setTime(double time) {
		this.time = time;
	}

	public int compareTo(Object o) {
		Individual p = (Individual) o ;
		if(this.time > p.time)
			return 1;
		else if (this.time == p.time)
			return 0;
		else
			return -1;
	}
	public Individual copy()
	{
		Individual toReturn = new Individual(this.strategy.clone(),this.pacing.clone());
		return toReturn;
	}
	public String toString() {
		return "strategy=" + Arrays.toString(strategy)
				+ "\n" + "pacing=" + Arrays.toString(pacing) + "\n" + "time=" + time;
	}
	
}
